from django.db import models

class News(models.Model):
    title = models.CharField(maxlength=50)
    date = models.DateField()
    description = models.TextField()
    screenshot = models.CharField(maxlength=50, null=True, blank=True)
    class Admin:
        list_display = ("title", "date")
#        ordering = ["date"]
 #       search_fields = ("title", "description")
  #      list_filter = ("date",)

    def __str__(self):
        if self.screenshot:
            return "%s, %s, %s, %s" % (self.title, self.date, self.screenshot, self.description)
        else:
            return "%s, %s, %s" % (self.title, self.date, self.description)